//
//  WebViewController.m
//  CarTown
//
//  Created by 熊浩 on 15/8/26.
//  Copyright (c) 2015年 熊浩. All rights reserved.
//

#import "WebViewController.h"

@interface WebViewController ()
@property (weak, nonatomic) IBOutlet UIWebView *webview;

@end

@implementation WebViewController
+(instancetype)ViewController{
    WebViewController *webvc=[[WebViewController alloc]initWithNibName:NSStringFromClass([self class]) bundle:nil];
    
    return webvc;
}
-(UIStatusBarStyle)preferredStatusBarStyle{
    return UIStatusBarStyleLightContent;
}
- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
       NSString * htmlPath;
    if (self.type==Question) {
      htmlPath=[[NSBundle mainBundle] pathForResource:@"question"
                                        ofType:@"html"];
        
        self.navigationItem.title=@"常见问题";
    }else{
        htmlPath=[[NSBundle mainBundle] pathForResource:@"agreement"
                                                 ofType:@"html"];
    self.navigationItem.title=@"车源用户协议";
    }
  
    NSString * htmlCont = [NSString stringWithContentsOfFile:htmlPath
                                                    encoding:NSUTF8StringEncoding
                                                       error:nil];
   NSString *csspath=[[NSBundle mainBundle] pathForResource:@"setting"
                                    ofType:@"css"];
    NSLog(@"%@",csspath);
    NSString *path = [[NSBundle mainBundle] bundlePath];
    path=[NSString stringWithFormat:@"%@/html",path];
    NSURL *baseURL = [NSURL fileURLWithPath:path];
    [self.webview loadHTMLString:htmlCont baseURL:baseURL];
    
    
    
   
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
